<template>
	<view v-if="cart_info" class="page">
		<userinfo id="user" :options="user_options" @getUserscope="getUserInfo" @toLogin="getUserInfo"></userinfo>

		<view :style="'background:' + mobile_head_color + ';padding-bottom:118px;'">
			<view class="header-wrapper" :style="'height:' + totalH + 'px;background:' + mobile_head_color + ';'">
				<view class="status-bar" :style="statusBarStyle + ' background:' + mobile_head_color + ' '"></view>
				<view class="navigation-bar" :style="navigationBarStyle + ' background:' + mobile_head_color">
					<view class="flex navigation" :style="navigationStyle">
						<view @tap="goBack">
							<text class="iconfont icon-arrow-left"></text>
						</view>
						<view class="flex select-btn" :style="'color:' + mobile_head_color + ';margin-left:' + titleLeft + 'px;'">
							<text :class="'item ' + (delivery_info.length == 1 ? 'no-pick' : '') + ' ' + (now_delivery == item.type ? 'active' : '' )"
							 v-for="(item, index) in delivery_info" :key="index" @tap="changeDeliver($event)" :data-type="item.type">{{item.name}}</text>
						</view>
					</view>
				</view>
				<view class="menu" :style="menuStyle"></view>
			</view>

			<view class=" address-box">
				<view style="width: 100%;" v-if="now_delivery != 'pick'">
					<view class="left" v-if="cart_info.user_adress && cart_info.user_adress.adress_id && (cart_info.user_adress.is_deliver || cart_info.delivery_type == 5 )">
						<view class="address">{{cart_info.user_adress.show_address}}</view>
						<view class="user">
							<view>{{cart_info.user_adress.name}} {{cart_info.user_adress.phone}}</view>
							<view class="right" :style="'color:' + mobile_head_color" @tap="changeAddress">
								<lang keywords="更改配送地址" chineseTxt="更改配送地址"></lang>
							</view>
						</view>
					</view>

					<view class="left" v-else-if="address_list.length > 0 && cart_info.user_adress && !cart_info.user_adress.is_deliver">
						<view class="tip">
							<lang keywords="当前选择的地址不在配送范围内" chineseTxt="当前选择的地址不在配送范围内"></lang>
						</view>
						<view class="right" :style="'color:' + mobile_head_color" @tap="changeAddress">
							<lang keywords="更改配送地址" chineseTxt="更改配送地址"></lang>
						</view>
					</view>

					<view class="left" v-else-if="address_list.length > 0 && cart_info.user_adress && cart_info.delivery_type != 5">
						<view class="tip">
							<lang keywords="已有配送地址均不在配送范围内" chineseTxt="已有配送地址均不在配送范围内"></lang>
						</view>
						<view class="right " :style="'color:' + mobile_head_color" @tap="changeAddress">
							<text class="iconfont icon-jia2"></text>
							<lang keywords="添加配送地址" chineseTxt="添加配送地址"></lang>
						</view>
					</view>

					<view class="left" v-else>
						<view class="tip">
							<lang keywords="暂时没有可用配送地址，请您添加配送地址" chineseTxt="暂时没有可用配送地址，请您添加配送地址"></lang>
						</view>
						<view class="right" :style="'color:' + mobile_head_color" @tap="add_address">
							<text class="iconfont icon-jia2"></text>
							<lang keywords="添加配送地址" chineseTxt="添加配送地址"></lang>
						</view>
					</view>
				</view>

				<view style="width: 100%;" v-if="now_delivery == 'pick' && cart_info">
					<view class="left" v-if="cart_info.pick_address && cart_info.pick_address.name">
						<view class="address" >{{cart_info.pick_address.show_address}}</view>
						<view class="user">
							<view>
								<lang keywords="电话" chineseTxt="电话"></lang> {{cart_info.pick_address.phone}}
							</view>
							<view class="right" v-if="cart_info.pick_address_count > 1" :style="'color:' + mobile_head_color" @tap="changePick">
								<lang keywords="更改自提地址" chineseTxt="更改自提地址"></lang>
							</view>
						</view>
					</view>
					<view class="left" v-if="!cart_info.pick_address || !cart_info.pick_address.name">
						<lang keywords="暂无自提地址" chineseTxt="暂无自提地址"></lang>
					</view>

				</view>

			</view>


		</view>

		<view style="margin-top: -118px;">

			<view class="flex time-box rel" v-if="now_delivery != 'pick' && cart_info.delivery_type != 5">
				<view class="left">
					<lang v-if="deliver_time_isnow == 0" keywords="指定时间" chineseTxt="指定时间"></lang>
					<lang v-if="deliver_time_isnow == 1" keywords="立即送达" chineseTxt="立即送达"></lang>
				</view>
				<view class="right" :style="'color:' + mobile_head_color">
					<block v-if="cart_info.deliver_time">
						<text>{{cart_info.deliver_show_day}} {{cart_info.deliver_show_time}}</text>
					</block>
					<block v-else>
						<lang keywords="请选择送达时间" chineseTxt="请选择送达时间"></lang>
					</block>
					<text class="iconfont icon-jiantou"></text>
				</view>
				<form :report-submit="true" class="formidForm" @submit="showTimer($event)" data-tag="showDeliveryTime">
					<button formType="submit" class="formidBtn"></button>
				</form>
			</view>

			<view class="self-pick" v-if="now_delivery == 'pick'">
				<view class="line flex rel border-b">
					<view class="left">
						<lang keywords="自提时间" chineseTxt="自提时间"></lang>
					</view>
					<view class="right" :style="'color:' + mobile_head_color + ';height:1.4rem'">
						<block v-if="cart_info.pick_time">
							<text>{{cart_info.pick_show_day}} {{cart_info.pick_show_time}}</text>
						</block>
						<block v-else>
							<lang keywords="请选择送达时间" chineseTxt="请选择送达时间"></lang>
						</block>
						<text class="iconfont icon-jiantou"></text>
					</view>
					<form :report-submit="true" class="formidForm" @submit="showTimer($event)" data-tag="showPickTime">
						<button formType="submit" class="formidBtn"></button>
					</form>
				</view>

				<view class="line flex">
					<view class="left">
						<lang keywords="联系人手机" chineseTxt="联系人手机"></lang>
					</view>
					<view class="right flex">
						<input :style="'color:' + mobile_head_color" placeholder="例：0435 000 000" type="number" :value="pick_phone"
						 @input="inputPickInfo($event)" data-tag="pick_phone"></input>
						<text class="iconfont icon-bianji1" style="display:none;"></text>
					</view>
				</view>

			</view>

			<view class="order-info">
				<view class="store-name rel border-b">{{cart_info.name}}</view>
				<view class="rel border-b">
					<view class="goods-item flex" v-for="(item, index) in cart_info.goods_list" :key="item.cart_goods" v-if="index < show_goods_num">
						<view class="goods-name">
							<block v-if="item.discount_type && (item.discount_type_data == 0 || item.discount_type_data == 1)">
								<lang class="icon discount" keywords="折" chineseTxt="折"></lang>
							</block>
							<block v-if="item.is_seckill_price">
								<lang class="icon limit" keywords="限"  chineseTxt="限"></lang>
							</block>
							<text class="name">{{item.name}}</text>
							<view class="gray desc">{{item.str}}</view>
						</view>
						<view class="gray num">×{{item.num}}</view>
						<view class="gray old-price">
							<block v-if="item.old_price_all != item.discount_price_all">
								{{currency + item.old_price_all}}
							</block>
						</view>
						<view class="price">
							{{currency + item.discount_price_all}}
						</view>
					</view>

					<view class="show-more " v-if="cart_info.goods_list && cart_info.goods_list.length > 3" @click.stop="showMoreGoods">
						<view class="block-in" v-if="show_goods_num == 3">
							<lang keywords="展开更多" chineseTxt="展开更多"></lang>
							<text class="iconfont icon-xiala"></text>
						</view>
						<view class="block-in" v-if="show_goods_num > 3">
							<lang keywords="点击收起" chineseTxt="点击收起"></lang>
							<text class="iconfont icon-jiantou1"></text>
						</view>
					</view>
				</view>
				
				<view class="rel border-b pd10-0" v-if="cart_info.packing_charge > 0 || now_delivery != 'pick' || deliverExtraPrice > 0 || (order_info && order_info.full_gift && order_info.full_gift.name)">
					<view class="flex line" v-if="order_info && order_info.full_gift && order_info.full_gift.name">
						<view class="left">
							<lang class="icon" keywords="满赠" style="background: #E72565;"></lang>
							<text>{{order_info.full_gift.name + order_info.full_gift.num + order_info.full_gift.unit}}</text>
						</view>
						<view class="right">{{currency + order_info.full_gift.price}}</view>
					</view>
					<view class="flex line" v-if="cart_info.packing_charge > 0">
						<view class="left">{{cart_info.pack_alias}}</view>
						<view class="right">
							{{currency + cart_info.packing_charge}}
						</view>
					</view>
					<!-- 是否启用预支付   is_vip  -->
					 <view class="flex line" v-if="cart_info.shop_svip_percent>0 && order_info.now_user.is_vip>0">
					  <view class="left">
					   <lang class="icon" keywords="预支付" style="background: #E72565;"></lang>
					   <!-- <text>这里防止一个radio</text> -->
						<radio-group>
							<label>
								<radio :value="1" :checked="yzf==1" @click="checkRadio(1)"/><text>预支付</text>
								<radio :value="0" :checked="yzf==0"  @click="checkRadio(0)"/><text>完全支付</text>
							</label>
						</radio-group>
					  </view>
					  <view class="right" v-if="order_info.now_user.is_vip>0 && yzf>0">{{cart_info.shop_svip_percent}}%</view>
					 </view>
					 <!-- is_vipend -->
					<view class="flex line" v-if="(now_delivery != 'pick')">
						<view class="left">{{cart_info.freight_alias}}</view>
						<view class="right">
							<text class="delivery-free" v-if="cart_info.deliveryFree">{{cart_info.deliveryFree}}</text>
							{{ currency + delivery_total }}
						</view>
					</view>
					<view class="flex line" v-if="deliverExtraPrice > 0">
						<view class="left">
							<lang keywords="不满起送价附加费" chineseTxt="不满起送价附加费"></lang>
						</view>
						<view class="right">
							{{currency + deliverExtraPrice}}
						</view>
					</view>
				</view>

				<view class="rel border-b pd10-0" v-if="cart_info.discount_list && cart_info.discount_list.length > 0 || (cart_info.deliver_minus_value && now_delivery != 'pick')">
					<block v-if="cart_info.discount_list.length > 0">
						<view class="flex line" v-for="(item, discount_list) in cart_info.discount_list" :key="discount_list" v-if="cart_info.discount_list.length > 0">
							<view class="left">
								<lang v-if="item.type == 'newuser' || item.type == 'system_newuser' " :class="'icon ' + item.type" keywords="首" chineseTxt="首"></lang>
								<lang v-else-if="item.type == 'system_minus'" :class="'icon ' + item.type" keywords="减" chineseTxt="减"></lang>
								<lang v-else :class="'icon ' + item.type" keywords="惠" chineseTxt="惠"></lang>
								<text>{{item.value}}</text>
							</view>
							<view class="right">-
								{{currency + item.minus}}</view>
						</view>
					</block>
					<view class="flex line" v-if="cart_info.deliver_minus_value && now_delivery != 'pick'">
						<view class="left">
							<lang class="icon minus" keywords="惠" chineseTxt="惠"></lang>
							<text>{{cart_info.deliver_minus_value}}</text>
						</view>
						<view class="right">-
							{{currency + cart_info.delivery_minus_money}}</view>
					</view>
				</view>

				<view class="rel border-b pd10-0" v-if="order_info">
					
					
					
					
					<view class="flex line" v-if="order_info.pay_config.card_discount != 0">
						<view class="left">
							<view>
								<lang keywords="商家会员卡折扣" chineseTxt="商家会员卡折扣"></lang>
							</view>
							<view class="tip" v-if="now_delivery != 'pick'">
								<lang keywords="运费不参与商家会员卡折扣" chineseTxt="运费不参与商家会员卡折扣"></lang>
							</view>
						</view>
						<view class="right" style="color:#FF1940">{{order_info.pay_config.card_discount}}折</view>
					</view>
					<view class="flex line" @tap="changeSystemCoupon">
						<view class="left">
							<lang keywords="平台优惠券" chineseTxt="平台优惠券"></lang>
						</view>
						<view class="right">
							<block v-if="!order_info.system_coupon.had_id">
								<lang v-if="order_info.has_system_coupon == 1" style="color:#FF1940" keywords="不使用优惠券" chineseTxt="不使用优惠券"></lang>
								<lang v-else style="color:#FF1940" keywords="无可用优惠券" chineseTxt="无可用优惠券"></lang>
							</block>
							<text v-else style="color:#FF1940">{{ order_info.system_coupon.coupon_des }}</text>
							<text class="iconfont icon-jiantou"></text>
						</view>
					</view>
					<view class="flex line" @tap="changeMerchantCoupon">
						<view class="left">
							<lang keywords="商家优惠券" chineseTxt="商家优惠券"></lang>
						</view>
						<view class="right">
							<block v-if="!order_info.mer_coupon.had_id">
								<lang v-if="order_info.has_merchant_coupon == 1" style="color:#FF1940" keywords="不使用优惠券" chineseTxt="不使用优惠券"></lang>
								<lang v-else style="color:#FF1940" keywords="无可用优惠券" chineseTxt="无可用优惠券"></lang>
							</block>
							<text v-else style="color:#FF1940">{{ order_info.mer_coupon.coupon_des }}</text>
							<text class="iconfont icon-jiantou"></text>
						</view>
					</view>
				</view>

				<view class="flex price-box">
					<view class="left" @click.stop="checkRule">
						<block v-if="cart_info.noDiscountList && cart_info.noDiscountList.length > 0">
							<lang keywords="优惠规则" chineseTxt="优惠规则"></lang>
							<text class="iconfont icon-iconset0143"></text>
						</block>
					</view>
					<view class="right flex">
						<view class="discount-price" style="color:#FF1940" v-if="cart_discount_price > 0">
							<lang keywords="优惠" chineseTxt="优惠"></lang>
							{{currency + cart_discount_price}}
						</view>
						<view class="price">
							<view class="txt block-in">
								<lang keywords="小计" chineseTxt="小计"></lang>
								<text>{{currency}}</text>
							</view>{{cart_need_price}}
						</view>
					</view>

				</view>

			</view>
		</view>
		
		<!-- 超值会员红包 -->
		<view class="flex line member-discount" @click="selectMember" v-if="order_info && order_info.upgrade_vip_level_info.is_show == 1">
			<view class="left">
				<view class="title">{{order_info.upgrade_vip_level_info.description}}</view>
				<view>{{order_info.upgrade_vip_level_info.sub_description}}</view>
			</view>
			<view class="right">
				<text class="price">{{currency + order_info.upgrade_vip_level_info.use_money}}</text>
				<text class="iconfont icon-gou" :style="'color:' + (isSelectMember ? mobile_head_color : '')"></text>
			</view>
			
			<view class="member-icon">
				<image class="img" src="../../../static/images/member-icon.png" mode="widthFix"></image>
				<text>{{ order_info.upgrade_vip_level_info.alias }}</text>
			</view>
		</view>
		
		<!-- 超值换购 -->
		<view class="discount-goods" v-if="cart_info.repurchase_list && cart_info.repurchase_list.is_show == 1">
			<view class="title">
				<lang class="icon" keywords="换"></lang>
				<lang class="tag" keywords="超值换购" chineseTxt="超值换购"></lang>
				<lang keywords="商品最多可为您节省X1" :X1="cart_info.repurchase_list.discount_money" unit="yuanSymbol"></lang>
			</view>
			<view class="goods-list">
				<view class="item-wrapper" v-for="(item, index) in cart_info.repurchase_list.goods">
					<view class="item" @click="selectRepurchaseGoods(index)">
						<view class="img-box">
							<image class="img" :src="item.image" mode="aspectFill"></image>
							<view class="discount-tag">
								<text>{{item.discount}}</text>
								<lang keywords="折" chineseTxt="折"></lang>
							</view>
							
						</view>
						<view class="info">
							<view class="goods-name">{{item.name}}</view>
							<view class="price">
								<text>{{currency}}</text>
								<text class="now-price">{{item.price}}</text>
								<text class="old-price">{{currency + item.old_price}}</text>
								<text :class="'iconfont icon-gou ' + (item.select == true ? 'active' : '')"></text>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="flex line rel border-b">
				<view class="left">
					<lang keywords="餐盒费" chineseTxt="餐盒费"></lang>
				</view>
				<view class="right">
					<text class="desc" >{{currency + repurchase_info.packing_charge}}</text>
				</view>
			</view>
			<view class="flex line">
				<view class="left"></view>
				<view class="right">
					<lang class="gray" keywords="已优惠" chineseTxt="已优惠"></lang>
					<text class="gray discount-price">{{currency + repurchase_info.discount_money}}</text>
					<lang keywords="合计" chineseTxt="合计"></lang>
					<text>{{currency}}</text>
					<text class="desc">{{repurchase_info.price}}</text>
				</view>
			</view>
		</view>
		
		<!-- 号码保护 -->
		<view class="flex line number-protect" v-if="cart_info.protect_phone_number">
			<view class="left">
				<view class="title">
					<image class="img" src="../../../static/images/number-protect.png" mode="widthFix"></image> 
					<lang keywords="平台已为您开启号码保护功能" chineseTxt="平台已为您开启号码保护功能"></lang>
				</view>
				<view><lang keywords="对商家、起手隐藏你的真实手机号，保护您的隐私" chineseTxt="对商家、起手隐藏你的真实手机号，保护您的隐私"></lang></view>
			</view>
		</view>
		
		<view class="remarks ">
			<view class="flex line rel border-b" @tap="setField($event)" data-type="own" data-label="desc">
				<view class="left">
					<lang keywords="订单备注" chineseTxt="订单备注"></lang>
				</view>
				<view class="right gray">
					<block v-if="order_desc  == ''">
						<lang 
							keywords="如有特殊要求，请详细标注分类、产品名及需求" 
							chineseTxt="如有特殊要求，请详细标注分类、产品名及需求"></lang>
					</block>
					<text class="desc" v-else>{{order_desc}}</text>
					<text class="iconfont icon-jiantou"></text>
				</view>
			</view>
			<view class="flex line rel border-b" @tap="setField($event)" data-type="own" data-label="invoice" v-if="cart_info.is_invoice != 0">
				<view class="left">
					<lang keywords="发票抬头" chineseTxt="发票抬头"></lang>
				</view>
				<view class="right gray">
					<block v-if="invoice_head  == ''">
						<lang keywords="点击填写发票抬头" chineseTxt="点击填写发票抬头"></lang>
					</block>
					<text class="desc" v-else>{{invoice_head}}</text>
					<text class="iconfont icon-jiantou"></text>
				</view>
			</view>
			<!-- item.type == 2 ? setSelectValue($event) :  -->
			<view class="flex line rel border-b" v-for="(item, index) in cart_info.cue_field" :key="index" @tap="setField($event)"data-type="cue" :data-label="index" :data-itemtype="item.type">
				<view class="left">{{item.iswrite ? '* ' : ''}}{{item.name}}</view>
				<view class="right gray">
					<text class="desc" v-if="item.value != ''">{{item.value}}</text>
					<block v-else-if="item.type == 2">
						<lang keywords="点击选择" chineseTxt="点击选择"></lang>
					</block>
					<block v-else>
						<lang keywords="点击填写X1" :X1="item.name" :chineseTxt="'点击填写'+item.name" :needUpdate="true"></lang>
					</block>
					<text class="iconfont icon-jiantou"></text>
				</view>
			</view>
		</view>

		<view class="bottom-box">
			<view class="repurchase-fixed" @click="scrollToRepurchase" v-if="cart_info.repurchase_list && cart_info.repurchase_list.is_show == 1 && cart_info.repurchase_list.goods.length > 0 && showRepurchaseFixed">
				<text class="now-price">{{currency + cart_info.repurchase_list.goods[0].price}}</text>
				<lang keywords="换购价值"></lang>
				<text class="brackets">[</text>
				<text>{{currency + cart_info.repurchase_list.goods[0].old_price}}</text>
				<text class="name">{{cart_info.repurchase_list.goods[0].name}}</text>
				<text class="brackets">]</text>
				<text class="iconfont icon-xiangxia"></text>
			</view>

			<view class="address-mask flex" v-if="showAddressFixed">
				<block v-if="now_delivery != 'pick'">
					<block v-if="cart_info.user_adress && cart_info.user_adress.adress_id && (cart_info.user_adress.is_deliver || cart_info.delivery_type == 5 )">
						<view class="left">
							<view class="address">{{cart_info.user_adress.show_address}}</view>
							<view class="user">{{cart_info.user_adress.name}} {{cart_info.user_adress.phone}}</view>
						</view>
						<view class="right" style="color:#FF1940" @click.stop="changeAddress">
							<lang keywords="更改配送地址" class="txt"></lang>
						</view>
					</block>

					<block v-else-if="address_list.length > 0 && !cart_info.user_adress.is_deliver">
						<view class="left">
							<view class="address">
								<lang keywords="当前选择的地址不在配送范围内"></lang>
							</view>
						</view>
						<view class="right" style="color:#FF1940" @click.stop="changeAddress">
							<lang keywords="更改配送地址" class="txt"></lang>
						</view>
					</block>

					<block v-else-if="address_list.length > 0 && cart_info.delivery_type != 5">
						<view class="left">
							<view class="address">
								<lang keywords="已有配送地址均不在配送范围内"></lang>
							</view>
						</view>
						<view class="right" style="color:#FF1940" @click.stop="changeAddress">
							<text class="iconfont icon-jia2"></text>
							<lang keywords="添加配送地址" class="txt"></lang>
						</view>
					</block>

					<block v-else>
						<view class="left">
							<view class="tip">
								<lang keywords="暂时没有可用配送地址"></lang>
							</view>
						</view>
						<view class="right" style="color:#FF1940" @click.stop="add_address">
							<text class="iconfont icon-jia2"></text>
							<lang keywords="添加配送地址" class="txt"></lang>
						</view>
					</block>
				</block>

				<block v-if="now_delivery == 'pick'">
					<block v-if="cart_info.pick_address.name">
						<view class="left">
							<view class="address">{{cart_info.pick_address.show_address}}</view>
							<view class="user">
								<lang keywords="电话"></lang> {{cart_info.pick_address.phone}}
							</view>
						</view>
						<view class="right" v-if="cart_info.pick_address_count > 1" style="color:#FF1940" @click.stop="changePick">
							<lang keywords="更改自提地址" class="txt"></lang>
						</view>
					</block>
					<view class="left" v-else>
						<lang keywords="暂无自提地址"></lang>
					</view>

				</block>

			</view>

			<view class="bottom-btn flex">
				<view class="left flex">
					<view class="price">
						<view>
							<lang keywords="合计"></lang>
							<text>{{currency}}</text>
							<text class="num">{{cart_need_price_all}}</text>
						</view>
						<view class="gray" v-if="cart_discount_price > 0">
							<lang keywords="已优惠" chineseTxt="已优惠"></lang>
							{{currency + cart_discount_price_all}}
						</view>
					</view>
					<view class="pay-by-others" v-if="showOtherPay" @tap="saveOrder($event)" data-tag="payByOthers"><lang keywords="找人付" chineseTxt="找人付"></lang></view>
				</view>
				<view class="right" @tap="saveOrder($event)" data-tag="btn">
					<lang keywords="提交订单"></lang>
				</view>
			</view>
		</view>

		<!--弹层 选择收货地址-->
		<addressSelectBox ref="selectAddress" :showMask="showAddress" :addressId="address_id" :storeId='store_id' 
		@addressHandle="addressHandle"></addressSelectBox>

		<!-- 配送时间选择弹窗 -->
		<view class="timer_box" :style="'display:' + (showDeliveryTime ? 'block' : 'none')">
			<view class="mask" @tap="hideTime($event)" data-tag="showDeliveryTime"></view>
			<view class="timer">
				<view class="header">
					<lang keywords="期望送达"></lang>
				</view>
				<view class="content">
					<scroll-view class="day" scroll-y="true">
						<block v-for="(item, deliver_time_left) in deliver_time_list" :key="deliver_time_left">
							<view :class="'item ' + (cart_info.deliver_day == item.ymd ? 'active' : '')" 
							:style="cart_info.deliver_day == item.ymd ? ('color:' + mobile_head_color) : ''" @tap="changeDeliveryDay(deliver_time_left)">{{item.show_date}}</view>
						</block>
					</scroll-view>
					<scroll-view class="time" scroll-y="true" :scroll-top="delivery_time_scroll">
						<block v-for="(item, deliver_time_right) in deliver_time_list" :key="deliver_time_right">
							<view class="item_box" :style="'display:' + (cart_info.deliver_day == item.ymd ? 'block' : 'none')">
								<block v-for="(jtem, deliver_time_right_index) in item.date_list" :key="deliver_time_right_index">
									<view :class="'item ' + (cart_info.deliver_time == jtem.hour_minute ? 'active' : '')" 
										@tap="changeDeliveryTime(deliver_time_right, deliver_time_right_index)">
										<lang v-if="jtem.is_right_now == 1" keywords="立即送达"></lang>
										<text v-else>{{jtem.show_hour_minute}}</text>
										<view class="price">
											({{currency + jtem.delivery_fee}}
											<lang keywords="配送费"></lang>)
										</view>
										<text class="iconfont icon-gou" :style="cart_info.deliver_time == jtem.hour_minute ? ('color:' + mobile_head_color) : ''"></text>
									</view>
								</block>
							</view>
						</block>
					</scroll-view>
				</view>
			</view>
		</view>

		<!-- 自提时间选择弹窗 -->
		<view class="timer_box" :style="'display:' + (showPickTime ? 'block' : 'none')">
			<view class="mask" @tap="hideTime($event)" data-tag="showPickTime"></view>
			<view class="timer">
				<view class="header">
					<lang keywords="自提时间"></lang>
				</view>
				<view class="content">
					<scroll-view class="day" scroll-y="true">
						<block v-for="(item, pick_time_left) in pick_time_list" :key="pick_time_left">
							<view :class="'item ' + (cart_info.pick_day == item.ymd ? 'active' : '')" 
							:style="cart_info.pick_day == item.ymd ? ('color:' + mobile_head_color) : ''" 
							:data-ymd="item.ymd" @tap="changePickDay($event)">{{item.show_date}}</view>
						</block>
					</scroll-view>
					<scroll-view class="time" scroll-y="true">
						<block v-for="(item, deliver_time_right) in pick_time_list" :key="deliver_time_right">
							<view class="item_box" :style="'display:' + (cart_info.pick_day == item.ymd ? 'block' : 'none')">
								<block v-for="(jtem, deliver_time_right_index) in item.date_list" :key="deliver_time_right_index">
									<view :class="'item ' + (cart_info.pick_time == jtem.hour_minute ? 'active' : '')" @tap="changePickTime($event)"
									 :data-hour_minute="jtem.hour_minute" :data-time_select="jtem.time_select" :data-show_hour="jtem.show_hour_minute">
									 {{jtem.show_hour_minute}}
									 <text class="iconfont icon-gou" :style="cart_info.pick_time == jtem.hour_minute ? ('color:' + mobile_head_color) : ''"></text>
									</view>
								</block>
							</view>
						</block>
					</scroll-view>
				</view>
			</view>
		</view>

		<!-- 单选弹层 -->
		<view class="select-box" :hidden="!showSelected">
			<view class="mask" @tap="hideSelectBox"></view>
			<view class="content">
				<view class="item-box">
					<view class="item" v-for="(item, index) in selectArr" :key="index" @tap="confirmSelected($event)" :data-index="index">{{item}}</view>
				</view>

				<view class="cancel">
					<view class="item" @tap="hideSelectBox">
						<lang keywords="取消"></lang>
					</view>
				</view>
			</view>
		</view>

		<!-- 优惠规则弹层 -->
		<view class="discount-rule" :hidden="!showDiscountMask">
			<view class="mask" @click.stop="closeDiscountMask" catchtouchmove="forbidMove"></view>
			<view class="content-box">
				<view class="title">
					<lang keywords="优惠规则"></lang>
				</view>
				<view class="list" :style="'max-height:' + dicountMaskH + 'px;'">
					<view class="item" v-for="(item, index) in cart_info.noDiscountList" :key="index">
						<text>{{index + 1}}、</text>{{item.value}}</view>
				</view>
				<view>
					<button class="btn" @click.stop="closeDiscountMask">
						<lang keywords="知道了"></lang>
					</button>
				</view>
			</view>
		</view>
		<ttdShowModal :show='ttdShow' @closeModal='closeModal' />
	</view>
</template>

<script>
	import common from '../../../utils/common.js'
	import head from '../../../utils/customHead.js'
	import addressSelectBox from '../../../appComponent/platcommon/addressSelectBox.vue'
	import ttdShowModal from '../../common/ttd-show-modal.vue'
	var systemInfo = '';
	var _this;
	var app = getApp();
	var rpxUnit = 0;
	var go_action = '';
	var order_mask_type = '';
	var order_mask_title = '';
	var order_mask_value = '';
	var order_mask_label = '';
	var order_mask_iswrite = '';

	export default {
		data() {
			return {
				yzf:0,
				store_id: 0,
				store_name: '',
				fromType: '',
				cart_info: {
					packing_charge: 0,
					delivery_minus_money: 0
				},
				now_delivery: '',
				system_height: 0,
				totalH: 0,
				showDeliveryTime: false,
				showPickTime: false,
				delivery_money: 0,
				delivery_time_scroll: 0,
				order_desc: '',
				invoice_head: '',
				pick_id: '',
				cart_all_price: 0,
				cart_discount_price: 0,
				cart_need_price: 0,
				cart_discount_price_all: 0,
				cart_need_price_all: 0,
				showAddress: false,
				address_list: [],
				address_id: -1,
				shop_scan: '',
				// 标记是否是扫码自助购物
				cartId: '',
				// 是否设置了默认地址
				deliverExtraPrice: 0,
				// 加价送
				showSelected: false,
				show_goods_num: 3,
				titleLeft: 70,
				delivery_info: [],
				showDiscountMask: false,
				// 是否显示优惠规则弹窗
				tmp_order_id: 1,
				saveOrderType: '',
				order_info: '',
				use_score: false,
				use_merchant_money: false,
				use_balance_money: false,
				use_sys_coupon: true,
				use_mer_coupon: true,
				system_coupon_id: 0,
				merchant_coupon_id: 0,
				pick_phone: '',
				showAddressFixed: false,
				user_options: {},
				statusBarStyle: '',
				navigationBarStyle: '',
				navigationStyle: '',
				menuStyle: '',
				delivery_total: '',
				mobile_head_color: '',
				order_id: '',
				deliver_time_list: [],
				pick_time_list: [],
				selectArr: [],
				dicountMaskH: '',
				currency: '¥',
				order_type: 'shop',
				showRepurchaseFixed: true,
				repurchase_info: {
					packing_charge: 0,
					discount_money: 0,
					price: 0
				},
				isSelectMember: false, // 是否选择了超级会员
				deliver_time_isnow: 1, // 配送时间是否显示立即送达
				showOtherPay: false, // 是否显示代付按钮
				ttdShow: false
			};
		},
		components: {
			addressSelectBox,
			ttdShowModal
		},
		onShow: function() {
			// 页面显示
 
			if (this.go_action == 'address' && uni.getStorageSync('edit_address_id')) {
				this.address_id = uni.getStorageSync('edit_address_id')
				_this.getCartInfo()
				this.go_action = ''
				uni.removeStorageSync('edit_address_id')
			}else if (go_action == 'pick_address') {
				var pick_id = wx.getStorageSync('pick_addr_id');

				if (pick_id) {
					var pick_addr_arr = wx.getStorageSync('pick_addr_arr');
					var cart_info = this.cart_info;
					cart_info.pick_address = pick_addr_arr;
					cart_info.pick_address.area_info = {
						'province': pick_addr_arr.province,
						'city': pick_addr_arr.city,
						'area': pick_addr_arr.area
					};
					wx.removeStorage({
						key: 'pick_addr_id'
					});
					wx.removeStorage({
						key: 'pick_addr_arr'
					});
					go_action = '';
					this.pick_id = pick_id
					this.cart_info = cart_info
				} 
			} else if (go_action == 'order_mark') {
				var order_value = uni.getStorageSync('order_value');
 
				uni.removeStorage({
					key: 'order_value'
				});
				
				if (order_mask_type == 'own') {
					if (order_mask_label == 'desc') {
						_this.order_desc = order_value ? order_value : _this.order_desc;
					} else if (order_mask_label == 'invoice') {
						_this.invoice_head = order_value ? order_value : _this.invoice_head;
					}
				} else if (order_mask_type == 'cue') {
					_this.cart_info = this.cart_info;
					_this.cart_info.cue_field[order_mask_label].value = order_value;
					_this.$forceUpdate()
				}
			} else if (go_action == 'bind_phone') {
				if (app.globalData.userInfo.phone == '') {
					uni.showModal({
						title: common.changeTxt('温馨提示'),
						content: common.changeTxt('为了保护您的权益，下单前您需要绑定手机号码。'),
						showCancel: true,
						success(res) {
							if (res.confirm) {
								go_action = 'bind_phone';
								uni.navigateTo({
									url: '/pages/my/newnumber'
								});
							} else if (res.cancel) {
								uni.navigateBack();
							}
						}
					});
				}
			} 

			uni.getStorage({
				key: 'coupon_action',
				success: function(res) {
					var coupon_type = uni.getStorageSync('coupon_type');
					uni.removeStorage({
						key: 'coupon_action'
					});
					uni.removeStorage({
						key: 'coupon_type'
					});

					if (res.data == 'not') {
						if (coupon_type == 'system') {
							_this.use_sys_coupon = false;
						} else {
							_this.use_mer_coupon = false;
						}
					} else if (res.data == 'use') {
						if (coupon_type == 'system') {
							_this.use_sys_coupon = true;
							_this.system_coupon_id = uni.getStorageSync('coupon_id');
						} else {
							_this.use_mer_coupon = true;
							_this.merchant_coupon_id = uni.getStorageSync('coupon_id');
						}

						uni.removeStorage({
							key: 'coupon_id'
						});
					}
					_this.autoSaveOrder();
				}
			});
			// #ifdef H5
			common.hideWxShare()
			// #endif
		},
		onLoad: function(options) {
			if(options.store_id === '11') {
				this.ttdShow = true
			}
			_this = this;
			common.setMainColor(_this, (config) => {
				
				_this.currency = config.config.Currency_symbol
				_this.showOtherPay = config.is_open_pay_for_others == 1
			});
			systemInfo = wx.getSystemInfoSync();
			rpxUnit = systemInfo.windowWidth / 750;
			_this.navigationBarStyle = head.getNavigationBarStyle(_this, systemInfo)
			_this.statusBarStyle = head.getStatusBarStyle(_this, systemInfo)
			_this.navigationStyle = head.getNavigationStyle(_this, systemInfo)
			_this.menuStyle = head.getMenuStyle(_this, systemInfo)
			_this.store_id = options.store_id
			_this.store_name = options.store_name ? options.store_name : ''
			_this.system_height = systemInfo.windowHeight - 110 * rpxUnit
			_this.shop_scan = options.shop_scan ? options.shop_scan : ''
			_this.cartId = options.cartId ? options.cartId : ''
			_this.deliverExtraPrice = options.deliverExtraPrice ? options.deliverExtraPrice : 0
			_this.dicountMaskH = systemInfo.windowHeight * 0.7 - 96
			_this.systemInfo = systemInfo

			var titleLeft = (systemInfo.windowWidth - 20 - 164) / 2 - 25;
			if (systemInfo.windowWidth < 375) {
				titleLeft = (systemInfo.windowWidth - 30 - 164 - _this.capsuleInfo.width - 20) / 2;
			}
			_this.titleLeft = titleLeft
		
			this.onReadyFun()
		},
		props: {},
		methods: {
			closeModal() {
				console.log('关闭了');
				this.ttdShow = false
			},
			selectMember () {
				_this.isSelectMember = !_this.isSelectMember
				_this.autoSaveOrder()
			},
			scrollToRepurchase () {
				
				_this.showRepurchaseFixed = false
				uni.pageScrollTo({
					scrollTop: _this.repurchaseRect.top,
					duration: 200
				})
			},
			// 选择超值换购商品
			selectRepurchaseGoods (index) {
				let list = _this.cart_info.repurchase_list.goods
				if (!list[index].select) {
					list[index].select = true
				} else {
					list[index].select = false
				}
				_this.cart_info.repurchase_list.goods = list
				_this.$forceUpdate()
				_this.autoSaveOrder()
			},
			goBack () {
				 common.navigateBack()
			},
			onReadyFun () {
				common.getUserInfo(function(userInfo) {
					_this.getCartInfo()
					getAddressList()
					if (userInfo.phone == "") {
						uni.showModal({
							title: common.changeTxt('温馨提示'),
							content: common.changeTxt('为了保护您的权益，下单前您需要绑定手机号码。'),
							showCancel: true,
							success(res) {
								if (res.confirm) {
									go_action = 'bind_phone';
									uni.navigateTo({
										url: '/pages/my/newnumber'
									});
								} else if (res.cancel) {
									uni.navigateBack();
								}
							}
						});
					}
				}, 'setting');
				uni.removeStorage({
					key: 'order_value'
				});
				uni.removeStorage({
					key: 'use_address_id'
				});
			},
			getCartInfo(deliver_type) {
				// 发送购物车数据请求
				var address = app.globalData.delivery_address;
				if (!address) {
					common.getLocation(function(res){
						address = res
						if (!address.lng) {
							address = ''
						}
						app.globalData.delivery_address = address
						_this.postCart(res)
					}, _this, 'baidu')
				} else {
					_this.postCart(address)
				}
			},
			
			postCart (address) {
				var deliverExtraPrice = _this.deliverExtraPrice > 0 ? 1 : 0;
				var param = {
					store_id: _this.store_id,
					adress_id: _this.address_id,
					pick_addr_id: _this.pick_id,
					productCart: _this.productCart,
					long: address ? address.lng : 0,
					lat: address ? address.lat : 0,
					shop_scan: _this.shop_scan,
					cartid: _this.cartId,
					deliverExtraPrice: deliverExtraPrice,
					deliver_type: this.now_delivery == 'pick' ? 1 : 0
				}
				common.post('Shop&a=ajax_cart', param, "setPageContent", _this, 'back');
			},

			getUserInfo(e) {
				if (e.detail.userInfo && e.detail.userInfo.email == '') {
					wx.showModal({
						title: common.changeTxt('温馨提示'),
						content: common.changeTxt('为了保护您的权益，下单前您需要绑定邮箱地址。'),
						showCancel: false,

						success(res) {
							go_action = 'bind_email';
							common.parseUrl('/wap.php?c=My&a=email', '', false, common.changeTxt('填写邮箱'));
						}

					});
				}
			},

			//选择商家优惠券
			changeMerchantCoupon: function(e) {
				 

				if (e.type == 'submit') {
					common.upFormid(e);
				}

				wx.navigateTo({
					url: "/pages/pay/coupon?order_id=" + this.order_id + '&type=' + this.order_type + '&coupon_type=mer&coupon_id=' +
						this.merchant_coupon_id + '&temp_order_id=' + this.temp_order_id
				});
			},
			// 选择平台优惠券
			changeSystemCoupon: function(e) {
				 

				if (e.type == 'submit') {
					common.upFormid(e);
				}

				wx.navigateTo({
					url: "/pages/pay/coupon?order_id=" + this.order_id + '&type=' + this.order_type +
						'&coupon_type=system&coupon_id=' + this.system_coupon_id +'&temp_order_id=' + this.temp_order_id
				});
			},
			changePick: function(e) {
				go_action = 'pick_address';
				wx.navigateTo({
					url: "../../my/pick_address?pick_id=" + this.cart_info.pick_address.pick_addr_id + '&mer_id=' + this.cart_info.mer_id +
						"&fromType=shop&store_id=" + this.store_id
				});
			},
			setField: function(e) {
				const type =  e.currentTarget.dataset.itemtype;
				if(type == 2) {
					_this.setSelectValue(e)
				}else {
					order_mask_title = '';
					order_mask_value = '';
					order_mask_iswrite = '0';
					order_mask_type = e.currentTarget.dataset.type;
					order_mask_label = e.currentTarget.dataset.label;
					if (e.currentTarget.dataset.type == 'own') {
						if (e.currentTarget.dataset.label == 'desc') {
							order_mask_title = common.changeTxt('订单备注');
							order_mask_value = this.order_desc;
						} else if (e.currentTarget.dataset.label == 'invoice') {
							order_mask_title = common.changeTxt('发票抬头');
							order_mask_value = this.invoice_head;
						}
					} else if (e.currentTarget.dataset.type == 'cue') {
						order_mask_title = this.cart_info.cue_field[e.currentTarget.dataset.label].name;
						order_mask_value = this.cart_info.cue_field[e.currentTarget.dataset.label].value;
						order_mask_iswrite = this.cart_info.cue_field[e.currentTarget.dataset.label].iswrite;
					}
					go_action = 'order_mark';
					wx.navigateTo({
						url: "order_mark?title=" + order_mask_title + '&value=' + order_mask_value + '&iswrite=' + order_mask_iswrite
					});
				}
			},

			setSelectValue(e) {
				this.selectIndex = e.currentTarget.dataset.label
				this.selectArr = this.cart_info.cue_field[e.currentTarget.dataset.label].use_field
				this.showSelected = true
			},

			hideSelectBox() {
				this.showSelected = false
			},

			confirmSelected(e) {
				var selectIndex = this.selectIndex;
				var index = e.currentTarget.dataset.index;
				this.cart_info.cue_field[selectIndex].value = this.selectArr[index];
				this.showSelected = false
				this.cart_info = this.cart_info
			},

			changeAddress: function(e) {
				 

				if (e.type == 'submit') {
					common.upFormid(e);
				}
				this.showAddress = true
			 
			},
			
			add_address: function(e) {
				this.go_action = 'address'
				wx.navigateTo({
					url: "../../my/address_add"
				});
			},
			addressHandle: function (e) {
				if (e.add) {
					this.go_action = 'address'
				} else if (e.select && e.select.adress_id != this.address_id) {
					this.cart_info.user_adress = e.select
					this.address_id = e.select.adress_id
					this.getCartInfo()
				}
				this.showAddress = false
			},
			setPageContent: function(result) {
				var deliveryFree = ''
				var deliver_time_list = [];
				var deliver_time = "";
				var deliver_day = "";
				var deliver_show_day = "";
				var deliver_show_time = "";
				var deliver_minus_value = "";
				var delivery_money = 0;
				var delivery_minus_money = 0;
				var delivery_info = [];
				var pick_time_list = [];
				var pick_time, pick_day, pick_show_day, pick_show_time;
				result['price'] = parseFloat(result['price']);
				result['packing_charge'] = parseFloat(result['packing_charge']);
				result['discount_price'] = parseFloat(result['discount_price']);

				if (Object.keys(_this.cart_info).length == 2) {
					if (result.showSendTimeTip === true) {
						wx.showModal({
							title: common.changeTxt('期望到达时间提醒'),
							content: common.changeTxt('请注意，离现在最近的可选择到达时间是X1', {
								X1: result.deliver_time_list[0].show_date + result.deliver_time_list[0].date_list[0].hour_minute
							}),
							showCancel: false
						});
					}
				}
			
				// 0：平台配送 1：商家配送 2：到店自取 3：平台配送和到店自取 4：商家配送和到店自取 5：快递配送
				if (result.delivery_type == '0' || result.delivery_type == '3') {
					var now_delivery = 'system_deliver'; 
				} else if (result.delivery_type == '1' || result.delivery_type == '4') {
					var now_delivery = 'merchant_deliver'; 
				} else if (result.delivery_type == '2') {
					var now_delivery = 'pick'; 
				} else if (result.delivery_type == '5') {
					var now_delivery = 'express';
				}
				if (result.delivery_type != '2') {
					if (result.delivery_type == '5') {
						delivery_info.push({
							name: common.changeTxt('快递配送'),
							type: now_delivery
						});
					}else{
						delivery_info.push({
							name: common.changeTxt('配送上门'),
							type: now_delivery
						});
					}
				}
				if (result.delivery_type == '2' || result.delivery_type == '3' || result.delivery_type == '4') {
					delivery_info.push({
						name: common.changeTxt('到店自取'),
						type: 'pick'
					});
				}

				if (result.user_adress.adress_id && result.user_adress.is_deliver) {
					_this.address_id = result.user_adress.adress_id;
				}

				if (result.pick_address.pick_addr_id) {
					_this.pick_id = result.pick_address.pick_addr_id;
				}

				if (result.pick_phone) {
					_this.pick_phone = result.pick_phone;
				} else if (app.globalData.userInfo.phone) {
					_this.pick_phone = app.globalData.userInfo.phone;
				}

				for (var i in result.deliver_time_list) {
					let item = result.deliver_time_list[i]
					deliver_day = item.ymd;
					deliver_show_day = item.show_date;
					deliver_show_time = item.date_list[0].show_hour_minute;
					deliver_time = item.date_list[0].hour_minute;
					delivery_money = item.date_list[0].delivery_fee * 1;
					if (item.date_list[0].delivery_free == 1) {
						deliveryFree = common.changeTxt('免配送费')
					} else if (item.date_list[0].delivery_free == 2) {
						deliveryFree = common.changeTxt('满' + _this.currency + 'X1免配送费', {X1: item.date_list[0].delivery_free_money})
					}

					if (result.deliver_minus_list.length > 0) {
						for (var j in result.deliver_minus_list) {
							var str = 'delivery_fee_reduce_type' + item.date_list[0].time_select;
							let minusItem = result.deliver_minus_list[j]
							if (minusItem.time_select == item.date_list[0].time_select && (result[str] == 'manjian' && minusItem.type == 'delivery' || result[str] == 'zhekou' && minusItem.type == 'delivery_zhekou' || !result[str])) {
								deliver_minus_value = minusItem.value;
								delivery_minus_money = minusItem.minus;
								break;
							}
						}
					}

					deliver_time_list = result.deliver_time_list;
					delete result.deliver_time_list;
					break;
				}

				result['deliver_day'] = deliver_day;
				result['deliver_show_day'] = deliver_show_day;
				// result['deliver_time'] = deliver_time;
				result['deliver_show_time'] = deliver_show_time;
				result['deliver_minus_value'] = deliver_minus_value;
				result['delivery_minus_money'] = delivery_minus_money * 1;
				result['deliveryFree'] = deliveryFree

				if (result.pick_time_list && result.pick_time_list.length > 0) {
					pick_day = result.pick_time_list[0].ymd;
					pick_show_day = result.pick_time_list[0].show_date;
					pick_show_time = result.pick_time_list[0].date_list[0].show_hour_minute;
					pick_time = result.pick_time_list[0].date_list[0].hour_minute;
					result['pick_day'] = pick_day;
					result['pick_show_day'] = pick_show_day;
					result['pick_time'] = pick_time;
					result['pick_show_time'] = pick_show_time;
					pick_time_list = result.pick_time_list;
					delete result.pick_time_list;
				}

				_this.now_delivery = _this.now_delivery == '' ? now_delivery : _this.now_delivery;
				
				if (result.cue_field.length > 0) {
					for (var i in result.cue_field) {
						result.cue_field[i].value = '';
					}
				} 
				if (_this.cart_info && _this.cart_info['cue_field']) {
					 
					result['cue_field'] = _this.cart_info['cue_field']
				}
				
				_this.cart_info = result;

				_this.autoSaveOrder();

				if (result.cue_field.length > 0) {
					for (var i in result.cue_field) {
						result.cue_field[i].value = '';
					}
				} 
				// 优惠不同享
				result.noDiscountList = result.noDiscountList.map(item => {
					var str = '';
					item.value.split(/<|p|>|\//).map(i => {
						str = str + i;
						return i;
					});
					item.value = str;
					return item;
				});
				console.log('8888888888888',result);
				this.cart_info = result
				this.delivery_money = delivery_money
				this.delivery_total = (delivery_money * 1 + result.delivery_minus_money * 1).toFixed(2)
				this.delivery_info = delivery_info
				this.address_id = _this.address_id
				this.pick_id = _this.pick_id
				this.pick_phone = _this.pick_phone
				this.now_delivery = _this.now_delivery
				this.deliver_time_list = deliver_time_list
				this.pick_time_list = pick_time_list
		 
				changeCartPrice();
				wx.hideToast();
				
				// 超值换购
				if (_this.cart_info.repurchase_list && _this.cart_info.repurchase_list.is_show == 1 && !_this.repurchaseRect) {
					_this.getRepurchaseRect()
					
				} 
			},
			getRepurchaseRect () {
				setTimeout(function(){
					uni.createSelectorQuery().select('.discount-goods').boundingClientRect(res => {
						if (res) {
	 
							_this.repurchaseRect = res
						} else {
							_this.getRepurchaseRect()
						}
					}).exec()
				}, 500)
			},
			changeDeliver: function(e) {
				if (this.now_delivery == e.currentTarget.dataset.type) {
					return false;
				}
				uni.pageScrollTo({
				    scrollTop: 0,
				    duration: 0
				});
				this.now_delivery = e.currentTarget.dataset.type
				_this.use_mer_coupon = true;
				_this.use_sys_coupon = true;
				_this.system_coupon_id = '';
				_this.merchant_coupon_id = '';
				_this.order_info = ''
				_this.getCartInfo();
			},
			showTimer: function(e) {
			 
				let name = e.currentTarget.dataset.tag
				if (e.type == 'submit') {
					common.upFormid(e);
				}
				if ( (name == 'showDeliveryTime' && _this.deliver_time_list.length == 0 ) || (name == 'showPickTime' && _this.pick_time_list.length == 0)) {
					wx.showModal({
						title: common.changeTxt('提示'),
						content: common.changeTxt('暂无时间可选'),
						showCancel: false
					})
					return
				}
				this[e.currentTarget.dataset.tag] = true
			},
			hideTime: function(e) {
				this[e.currentTarget.dataset.tag] = false
			},
			changeDeliveryDay: function(index) {
				var time_list = _this.deliver_time_list;
				var cart_info = this.cart_info;
				var deliver_time = time_list[index].date_list[0].hour_minute;
				var deliver_day = time_list[index].ymd;
				var deliver_show_day = time_list[index].show_date;
				var delivery_money = time_list[index].date_list[0].delivery_fee;
				var deliver_minus_value = "";
				var delivery_minus_money = 0;
				
				var deliver_show_time = time_list[index].date_list[0].show_hour_minute;
				var deliver_time_isnow = time_list[index].date_list[0].is_right_now

				for (var j in cart_info.deliver_minus_list) {
					var str = 'delivery_fee_reduce_type' + time_list[i].date_list[0].time_select;
			
					if (cart_info.deliver_minus_list[j].time_select == time_list[i].date_list[0].time_select && (cart_info[str] ==
							'manjian' && cart_info.deliver_minus_list[j].type == 'delivery' || cart_info[str] == 'zhekou' && cart_info.deliver_minus_list[
								j].type == 'delivery_zhekou' || !cart_info[str])) {
						deliver_minus_value = cart_info.deliver_minus_list[j].value;
						delivery_minus_money = cart_info.deliver_minus_list[j].minus;
						break;
					}
				}

				cart_info['deliver_day'] = deliver_day;
				cart_info['deliver_show_day'] = deliver_show_day;
				cart_info['deliver_time'] = deliver_time;
				cart_info['deliver_minus_value'] = deliver_minus_value;
				cart_info['delivery_minus_money'] = delivery_minus_money;
				cart_info['deliver_show_time'] = deliver_show_time;
				this.cart_info = cart_info
				this.delivery_money = delivery_money
				this.delivery_time_scroll = 0
				this.delivery_total = (delivery_money * 1 + cart_info.delivery_minus_money * 1).toFixed(2)
				this.deliver_time_isnow = deliver_time_isnow
				_this.autoSaveOrder();
			},
			changeDeliveryTime: function(index, itemIndex) {
				var timeItem = this.deliver_time_list[index].date_list[itemIndex]
				var cart_info = this.cart_info;
				cart_info['deliver_time'] = timeItem.hour_minute;
				cart_info['deliver_show_time'] = timeItem.show_hour_minute;
				var delivery_money = timeItem.delivery_fee;
				var deliver_time_isnow = timeItem.is_right_now

				for (var i in cart_info.deliver_minus_list) {
					var str = 'delivery_fee_reduce_type' + timeItem.time_select;

					if (cart_info.deliver_minus_list[i].time_select == timeItem.time_select && (cart_info[str] ==
							'manjian' && cart_info.deliver_minus_list[i].type == 'delivery' || cart_info[str] == 'zhekou' && cart_info.deliver_minus_list[
								i].type == 'delivery_zhekou' || !cart_info[str])) {
						cart_info['deliver_minus_value'] = cart_info.deliver_minus_list[i].value;
						cart_info['delivery_minus_money'] = cart_info.deliver_minus_list[i].minus;
						break;
					}
				}

		 
				this.cart_info = cart_info
				this.delivery_money = delivery_money
				this.delivery_total = (delivery_money * 1 + cart_info.delivery_minus_money * 1).toFixed(2)
				this.showDeliveryTime = false
				this.deliver_time_isnow = deliver_time_isnow
				_this.autoSaveOrder();
			},
			changePickDay: function(e) {
	 
				var cart_info = this.cart_info;
				var pick_time = "";
				var pick_day = "";
				var pick_show_day = "";
				var pick_show_time = "";
				var time_list = this.pick_time_list;

				for (var i in time_list) {
					if (time_list[i].ymd == e.currentTarget.dataset.ymd) {
						pick_day = time_list[i].ymd;
						pick_show_day = time_list[i].show_date;
						pick_time = time_list[i].date_list[0].hour_minute;
						pick_show_time = time_list[i].date_list[0].show_hour_minute;
						break;
					}
				}

				cart_info.pick_day = pick_day;
				cart_info.pick_show_day = pick_show_day;
				cart_info.pick_time = pick_time;
				cart_info.pick_show_time = pick_show_time;
				this.cart_info = cart_info
			},
			changePickTime: function(e) {
				var cart_info = this.cart_info;
				cart_info['pick_show_time'] = e.currentTarget.dataset.show_hour;
				cart_info['pick_time'] = e.currentTarget.dataset.hour_minute;
				this.cart_info = cart_info
				this.showPickTime = false
			},
			saveOrderResult: function(result) {
				if (_this.saveOrderType == 'payByOthers') {
	 
					common.parseUrl(_this.order_info.pay_by_others.url)
				} else {
					wx.navigateTo({
						url: `./pay?order_id=${result.order_id}&type=shop&use_sys_coupon=${_this.use_sys_coupon}&use_mer_coupon=${_this.use_mer_coupon}&system_coupon_id=${_this.system_coupon_id}&merchant_coupon_id=${_this.merchant_coupon_id}`
					});
				}
			},
			saveOrder: function(e) {
				if(!_this.cart_info.deliver_time){
					uni.showModal({
					    title: '提示',
					    content: '请选择配送时间',
					    success: function (res) {}
					});
					return
				}
				
				_this.saveOrderType = e.currentTarget.dataset.tag;
				
 
				var cart_info = _this.cart_info;
				var postObj = {};
				postObj.productCart = _this.productCart;
				
				postObj.ticket = uni.getStorageSync('ticket');
				postObj.store_id = _this.store_id;
				postObj.invoice_head = _this.invoice_head;
				postObj.cue_field = [];
				postObj.yzf = _this.yzf;//预支付
				postObj.shop_svip_percent = _this.cart_info.shop_svip_percent;
			
				postObj.desc = _this.order_desc;
				postObj.order_from = '4';
				postObj.cartid = _this.cartId;
				postObj.shop_scan = _this.shop_scan;
				postObj.upgrade_vip_level  = _this.isSelectMember ? 1 : 0
				postObj.live_id  = app.globalData.live_id
				postObj.video_id  = app.globalData.video_id
				
				let village_id = app.globalData.shopVilliageBind[_this.store_id]
				if (typeof village_id != 'undefined') {
					postObj.village_id = village_id
				}
				
				if (_this.now_delivery == 'pick' && _this.pick_phone == '') {
					wx.showModal({
						title: common.changeTxt('提示'),
						content: common.changeTxt('请填写自提信息！'),
						showCancel: false
					});
					return;
				}

				if (_this.now_delivery != 'pick' && cart_info.user_adress.adress_id && !cart_info.user_adress.is_deliver) {
					wx.showModal({
						title: common.changeTxt('提示'),
						content: common.changeTxt('已有地址均不在配送范围内， 请添加配送地址'),
						success: res => {
							if (res.confirm) {
								_this.changeAddress({});
							}
						}
					});
					return;
				}

				if (_this.now_delivery != 'pick' && !cart_info.user_adress.adress_id) {
					wx.showModal({
						title: common.changeTxt('提示'),
						content: common.changeTxt('暂时没有可用配送地址， 请添加配送地址'),
						success: res => {
							if (res.confirm) {
								_this.add_address();
							}
						}
					});
					return;
				}

				for (var i in _this.cart_info.cue_field) {
					if (_this.cart_info.cue_field[i].iswrite == 1 && _this.cart_info.cue_field[i].value == '') {
						wx.showModal({
							title: common.changeTxt('提示'),
							content: common.changeTxt('请填写X1', {
								X1: _this.cart_info.cue_field[i].name
							}),
							showCancel: false
						});
						return false;
					}

					postObj.cue_field.push({
						title: _this.cart_info.cue_field[i].name,
						txt: _this.cart_info.cue_field[i].value
					});
				}

				if (_this.now_delivery == 'pick') {
					postObj.pick_id = _this.pick_id;
					postObj.deliver_type = '1';
					postObj.userphone = _this.pick_phone;
					postObj.expect_use_time = _this.cart_info.pick_day + ' ' + _this.cart_info.pick_time;
				} else {
					postObj.address_id = _this.address_id;
					postObj.deliver_type = '0';
					postObj.expect_use_time = _this.cart_info.deliver_day + ' ' + _this.cart_info.deliver_time;
				}

				var time_list = _this.deliver_time_list;

				if (time_list && time_list[0] && (_this.cart_info.deliver_day != time_list[0].ymd || _this.cart_info.deliver_time !=
						time_list[0].date_list[0].hour_minute || _this.cart_info.showSendTimeTip === true)) {
					postObj.is_book_deliver = true;
				} else {
					postObj.is_book_deliver = false;
				}
				
				// 超值换购
				if (_this.cart_info.repurchase_list && _this.cart_info.repurchase_list.is_show == 1 && _this.cart_info.repurchase_list.goods.length > 0) {
					let str = ''
					for (let i = 0; i < _this.cart_info.repurchase_list.goods.length; i++) {
						if (_this.cart_info.repurchase_list.goods[i].select) {
							str = str + _this.cart_info.repurchase_list.goods[i].goods_id + ','
						}
					}
					str = str.slice(0, -1)
					if (str) {
						postObj.rep_id = _this.cart_info.repurchase_list.rep_id
						postObj.rep_goods_id = str
					}
				}
				console.log('保存订单的obj',postObj)
				common.post('Shop&a=save_order', postObj, "saveOrderResult", _this, "saveOrderError");
			},

			saveOrderError(res) {
				wx.showModal({
					title: '提示：',
					content: res.errorMsg,
					showCancel: false,
					success: function() {}
				});
 
			},

			// 展示更多
			showMoreGoods() {
				if (_this.show_goods_num == 3) {
					_this.show_goods_num = _this.cart_info.goods_list.length
				} else {
					_this.show_goods_num = 3
				}
			},
			//radio 
			checkRadio(e){
				console.log(this)
				console.log('radio',e)
				this.yzf = e
				console.log('调用一下autosaveorder')
				_this.autoSaveOrder()
			},
			// 点击查看优惠规则
			checkRule() {
				if (_this.cart_info.noDiscountList.length == 0) {
					return;
				}

				_this.showDiscountMask = true
			},

			closeDiscountMask() {
				_this.showDiscountMask = false
			},

			autoSaveOrder() {
				var cart_info = _this.cart_info
				var postObj = {}
				if (_this.now_delivery != 'pick' && ((cart_info.user_adress.adress_id && !cart_info.user_adress.is_deliver) || !cart_info.user_adress.adress_id)) {
					return;
				}
				
				postObj.productCart = _this.productCart
				postObj.store_id = _this.store_id
				postObj.yzf = _this.yzf //新增预支付
				postObj.invoice_head = _this.invoice_head
				postObj.cue_field = []
				postObj.desc = _this.order_desc
				postObj.order_from = '4'
				postObj.cartid = _this.cartId
				postObj.shop_scan = _this.shop_scan
				postObj.type = _this.order_type
				postObj.use_score = _this.use_score
				postObj.use_merchant_money = _this.use_merchant_money
				postObj.use_balance_money = _this.use_balance_money
				postObj.use_mer_coupon = _this.use_mer_coupon
				postObj.use_sys_coupon = _this.use_sys_coupon
				postObj.system_coupon_id = _this.system_coupon_id
				postObj.merchant_coupon_id = _this.merchant_coupon_id
				postObj.upgrade_vip_level  = _this.isSelectMember ? 1 : 0
				postObj.noTip = true
				
				if (_this.now_delivery == 'pick') {
					postObj.pick_id = _this.pick_id;
					postObj.deliver_type = '1';
					postObj.userphone = _this.pick_phone;
					postObj.expect_use_time = _this.cart_info.pick_day + ' ' + _this.cart_info.pick_time;
				} else {
					postObj.address_id = _this.address_id;
					postObj.deliver_type = '0';
					postObj.expect_use_time = _this.cart_info.deliver_day + ' ' + _this.cart_info.deliver_time;
				}
				
				var time_list = _this.deliver_time_list;
				
				if (time_list && time_list[0] && (_this.cart_info.deliver_day != time_list[0].ymd || _this.cart_info.deliver_time !=
						time_list[0].date_list[0].hour_minute || _this.cart_info.showSendTimeTip === true)) {
					postObj.is_book_deliver = true;
				} else {
					postObj.is_book_deliver = false;
				}
				
				// 超值换购
				if (_this.cart_info.repurchase_list && _this.cart_info.repurchase_list.is_show == 1 && _this.cart_info.repurchase_list.goods.length > 0) {
					let str = ''
					for (let i = 0; i < _this.cart_info.repurchase_list.goods.length; i++) {
						if (_this.cart_info.repurchase_list.goods[i].select) {
							str = str + _this.cart_info.repurchase_list.goods[i].goods_id + ','
						}
					}
					str = str.slice(0, -1)
					if (str) {
 
						postObj.rep_id = _this.cart_info.repurchase_list.rep_id
						postObj.rep_goods_id = str
					}
 
				}
				
 
				common.post('Shop_new&a=confirm', postObj, function (result) {
					
					console.log('qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq',result)
					
					
					
					var system_coupon_id = result.system_coupon.had_id != '' ? result.system_coupon.had_id : 0;
					var merchant_coupon_id = result.mer_coupon.had_id != '' ? result.mer_coupon.had_id : 0;
					
					if (result.system_coupon.had_id != '') {
						result.system_coupon.order_money = parseFloat(result.system_coupon.order_money);
					}
					
					if (result.mer_coupon.had_id != '') {
						result.mer_coupon.order_money = parseFloat(result.mer_coupon.order_money);
					}
					if ( Object.prototype.toString.call(result.upgrade_vip_level_info) == '[object Array]' ) {
						result.upgrade_vip_level_info = ''
					}
					console.log('22222222111', result)
					_this.order_info = result;
					_this.system_coupon_id = system_coupon_id;
					_this.merchant_coupon_id = merchant_coupon_id;
					_this.temp_order_id = result.temp_order_id
					
					_this.showOtherPay = result.pay_by_others.is_show == 1 ? true : false;
					
					changeCartPrice();
				}, _this, function (err) {

					_this.order_info = ''
					changeCartPrice();
				})
			},

			inputPickInfo(e) {
				_this[e.currentTarget.dataset.tag] = e.detail.value
			},

			onPageScroll(e) {
				var pageScrollTop = e.scrollTop;
				var addressH = 70;

				if (pageScrollTop >= addressH && !_this.showAddressFixed) {
					_this.showAddressFixed = true
				}

				if (pageScrollTop < addressH && _this.showAddressFixed) {
					_this.showAddressFixed = false
				}
				
				if (_this.showRepurchaseFixed) {
					_this.showRepurchaseFixed = false
				}
			}
		}
	};
	
	const changeCartPrice = order_info => {
		var yzf = _this.yzf,shop_svip_percent = _this.cart_info.shop_svip_percent;
		console.log(yzf,shop_svip_percent)
		var goods_price = _this.cart_info.price * 1;
		//	var goods_price = yzf>0? (_this.cart_info.price * 1)*shop_svip_percent/100;
		var delivery_money = _this.delivery_money * 1;
		var delivery_minus = _this.cart_info.delivery_minus_money * 1;
		var pack_money = _this.cart_info.packing_charge * 1;
		var discount_moner = _this.cart_info.discount_price * 1;
		var extra_money = _this.deliverExtraPrice * 1;

		if (_this.now_delivery == 'system_deliver' || _this.now_delivery == 'merchant_deliver' || _this.now_delivery ==
			'express') {
			 
			//订单总价
			// _this.cart_all_price = (goods_price + delivery_money + delivery_minus + pack_money + extra_money).toFixed(2); 
			//订单优惠
			_this.cart_discount_price = (discount_moner + delivery_minus).toFixed(2); 
			//订单待支付
			_this.cart_need_price = (goods_price + delivery_money + delivery_minus + pack_money - discount_moner -
				delivery_minus + extra_money).toFixed(2);
		} else {
			//订单总价
			// _this.cart_all_price = (goods_price + pack_money).toFixed(2); 
			//订单优惠
			_this.cart_discount_price = discount_moner.toFixed(2); 
			//订单待支付
			_this.cart_need_price = (goods_price + pack_money - discount_moner).toFixed(2);
		}
		
		_this.cart_discount_price_all = _this.cart_discount_price
		_this.cart_need_price_all = _this.cart_need_price
		//_this.cart_need_price_all = yzf>0? (_this.cart_need_price * Number(shop_svip_percent) / 100).toFixed(2):_this.cart_need_price
		if (_this.order_info) {
			_this.cart_discount_price_all = _this.cart_discount_price = (_this.cart_discount_price * 1 + _this.order_info.pay_config.total_money * 1 -
				_this.order_info.pay_config.pay_infact).toFixed(2);
			//_this.cart_need_price_all = _this.cart_need_price = _this.order_info.pay_config.pay_infact;
			_this.cart_need_price = _this.order_info.pay_config.pay_infact;
			_this.cart_need_price_all = yzf>0? (_this.cart_need_price * Number(shop_svip_percent) / 100).toFixed(2):_this.cart_need_price
			
			_this.repurchase_info = {
					packing_charge: 0,
					discount_money: 0,
					price: 0
				}
			if (_this.order_info.repurchase_info) {
				_this.repurchase_info = _this.order_info.repurchase_info
				_this.cart_discount_price_all = (_this.cart_discount_price * 1 + _this.order_info.pay_config.total_money_all * 1 -
				_this.order_info.pay_config.pay_infact_all).toFixed(2);
				_this.cart_need_price_all = _this.order_info.pay_config.pay_infact_all
			}
		} else {
			if (_this.cart_info.repurchase_list && _this.cart_info.repurchase_list.is_show == 1) {
				let repurchase_info = {
					packing_charge: 0,
					discount_money: 0,
					price: 0
				}
				let hasSelect = false
				for (let i = 0; i < _this.cart_info.repurchase_list.goods.length; i++) {
					let item = _this.cart_info.repurchase_list.goods[i]
					if (item.select) {
						hasSelect = true
						repurchase_info.packing_charge = repurchase_info.packing_charge + item.packing_charge * 1
						repurchase_info.discount_money = repurchase_info.discount_money + (item.old_price * 1 - item.price * 1)
						repurchase_info.price = repurchase_info.price + item.price * 1 + item.packing_charge * 1
					}
				}
				if (hasSelect) {
					_this.repurchase_info = repurchase_info
					_this.cart_need_price_all = _this.cart_need_price * 1 + repurchase_info.price
					_this.cart_discount_price_all = _this.cart_discount_price + repurchase_info.discount_money
				} else {
					repurchase_info.packing_charge = 0
					repurchase_info.discount_money = 0
					repurchase_info.price = 0
					
					_this.repurchase_info = repurchase_info
					_this.cart_need_price_all = _this.cart_need_price * 1 + repurchase_info.price
					_this.cart_discount_price_all = _this.cart_discount_price + repurchase_info.discount_money
				}
			}
		}
		
	};
	
	// 获取地址列表
	const getAddressList = () => {
		common.post('My&a=adress', {store_id: _this.store_id}, function(data) {
			if (data && data.length > 0) {
				_this.addressList = data;
			} else {
				_this.addressList = []
			}
		});
	}
</script>
<style>
	.page {
		background: #f7f7f7;
		padding-bottom: 150px;
	}

	.flex {
		display: flex;
		align-items: center;
	}

	.border-b::after {
		content: '';
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		height: 1rpx;
		background: #EDEDED;
		transform: scaleY(0.5);
	}

	.rel {
		position: relative;
	}

	.pd10-0 {
		padding: 10px 0;
	}

	.status-bar,
	.navigation-bar,
	.navigation,
	.menu {
		position: fixed;
		z-index: 999;
	}

	.header-wrapper {
		background: #06C1AE;
	}

	.navigation {
		color: #fff;
	}

	.navigation .iconfont {
		margin-left: 8rpx;
	}

	.navigation .select-btn {
		background: rgba(255, 255, 255, .8);
		height: 30px;
		line-height: 29px;
		font-size: 14px;
		border-radius: 20px;
		font-weight: 600;
		overflow: hidden;
	}

	.navigation .select-btn .item {
		padding: 0 13px;
		height: 100%;
		border-radius: 20px;
		display: inline-block;
	}

	.navigation .select-btn .item.active {
		background: #fff;
	}

	.navigation .select-btn .item.no-pick {
		width: 164px;
		text-align: center;
		box-sizing: border-box;
	}

	.address-box {
		height: 100px;
		padding: 10px 15px;
		display: flex;
		align-items: center;
		box-sizing: border-box;
	}

	.address-box .left,
	.address-mask .left {
		color: #fff;
		padding-right: 20px;
	}

	.address-box .address,
	.address-box .tip,
	.address-mask .left .address {
		font-size: 16px;
		font-weight: 500;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
		word-break: normal;
	}

	.address-box .user {
		font-size: 14px;
		line-height: 2;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.address-box .tip {
		font-size: 16px;
	}

	.address-box .right,
	.address-mask .right {
		color: #06C1AE;
		background: #fff;
		white-space: nowrap;
		font-size: 14px;
		padding: 4px 10px 5px;
		border-radius: 20px;
		font-weight: 600;
	}

	.address-box .right .iconfont {
		font-size: 14px;
		margin-right: 5px;
	}

	.address-box .left {
		float: none;
		width: 100%;
		padding-right: 0
	}

	.address-box .address {
		margin-bottom: 5px
	}

	.address-box .right {
		line-height: 1.5;
	}

	.address-box .left>.right {
		float: none;
		display: inline-block;
		margin-top: 10px;
	}

	.time-box {
		justify-content: space-between;
		padding: 15px 5px 15px 10px;
		background: #fff;
		margin: 5px 10px 10px;
		border-radius: 5px;
		font-size: 15px;
		box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.16);
	}

	.time-box .left {
		color: #373737;
		font-weight: 600;
	}

	.right .icon-jiantou {
		color: #bbb;
		font-size: 18px;
		font-weight: bold;
		vertical-align: middle;
	}

	.self-pick {
		background: #fff;
		margin: 5px 10px 10px;
		border-radius: 5px;
		font-size: 15px;
		box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.08);
		padding: 0 10px;
	}

	.self-pick .line {
		padding: 10px 0;
	}

	.self-pick .line .left {
		font-weight: 600;
	}

	.self-pick .line .right {
		font-size: 15px;
		flex-grow: 1;
		text-align: right;
	}

	.self-pick .line .right>input {
		flex-grow: 1;
	}

	.self-pick .line .right {
		color: #8E8E93;
	}

	.self-pick .line .right .icon-bianji1 {
		margin-left: 5px;
		color: #D6D6D6;
	}

	.order-info {
		background: #fff;
		background: #fff;
		margin: 0 10px;
		padding: 0 10px;
		border-radius: 5px;
		box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.08);
	}

	.store-name {
		background: #fff;
		padding: 15px 0;
		color: #585858;
		font-size: 16px;
		font-weight: 600;
	}

	.goods-item {
		align-items: flex-start;
		font-size: 14px;
		padding: 15px 0;
	}

	.goods-item>view {
		flex: 1;
		text-align: right;
	}

	.goods-item .goods-name {
		flex: 4;
		text-align: left;
	}

	.goods-item .goods-name .icon,
	.line .icon {
		color: #fff;
		padding: 0 3px;
		border-radius: 4px;
		font-size: 11px;
		margin-right: 5px;
	}

	.goods-item .goods-name .icon.discount {
		background: #FF1940;
	}

	.goods-item .goods-name .icon.limit {
		background: #FF9900
	}

	.goods-item .goods-name .desc {
		font-size: 11px;
		margin-top: 4px;
		line-height: 1.4;
	}

	.goods-item .gray {
		color: #999;
	}

	.goods-item .old-price {
		text-decoration: line-through;
	}

	.goods-item .price {
		color: #525252;
	}

	.show-more {
		font-size: 12px;
		color: #bbb;
		text-align: center;
		padding: 15px 0;
	}

	.show-more .iconfont {
		vertical-align: middle;
	}

	.line {
		justify-content: space-between;
		padding: 6px 0;
	}

	.line .left {
		color: #373737;
		font-size: 14px;
	}

	.line .left .tip {
		color: #999;
		font-size: 10px;
	}

	.line .right {
		color: #585858;
		font-size: 12px;
		white-space: nowrap;
	}

	.line .right.gray {
		color: #999;
	}

	.line .icon {
		background: #FF1940;
	}

	.line .icon.system_minus::before,
	.line .icon.system_newuser::before,
	.line .icon.newuser::before {
		content: '' !important;
	}

	.price-box {
		justify-content: space-between;
		align-items: baseline;
		font-size: 12px;
		padding: 10px 0 15px;
	}

	.price-box .left {
		font-size: 12px;
		color: #999;
		position: relative;
	}

	.price-box .left::after {
		content: '';
		position: absolute;
		top: -10px;
		left: -10px;
		right: -10px;
		bottom: -10px;
	}

	.price-box .left .iconfont {
		font-size: 13px;
		vertical-align: middle;
		margin-left: 5px;
	}

	.price-box .right {
		white-space: nowrap;
		align-items: baseline;
	}

	.price-box .right>view {
		margin-left: 10px;
		white-space: nowrap
	}

	.price-box .price {
		font-size: 20px;
		color: #525252
	}

	.price-box .price .txt {
		font-size: 14px;
	}

	.remarks {
		margin: 10px;
		background: #fff;
		padding: 0 10px;
		border-radius: 5px;
		box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.08);
	}

	.remarks .line {
		padding: 15px 0;
	}

	.remarks .line:last-child::after {
		height: 0;
	}

	.remarks .line .left {
		font-weight: 600;
		flex-shrink: 0
	}

	.remarks .line .right {
		flex-grow: 1;
		text-align: right;
		overflow: hidden;
	}

	.remarks .line .right .desc {
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: calc(100% - 30px);
		display: inline-block;
		vertical-align: middle;
	}

	.bottom-box {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		text-align: center;
	}

	.address-mask {
		height: 60px;
		background: rgba(55, 55, 55, .8);
		color: #fff;
		font-size: 14px;
		padding: 0 20px;
		justify-content: space-between;
		text-align: left;
	}

	.address-mask .left,
	.address-mask .left .address {
		font-size: 12px;
	}

	.address-mask .left .address {
		-webkit-line-clamp: 2;
	}

	.address-mask .right .iconfont {
		font-size: 14px;
		margin-right: 5px;
	}
	
	.address-mask .right .txt{
		white-space: nowrap;
	}

	.bottom-btn {
		height: 60px;
		height: calc(60px + env(safe-area-inset-bottom));
		height: calc(60px + constant(safe-area-inset-bottom));
		color: #fff;
		font-size: 14px;
	}

	.bottom-btn .left {
		flex-grow: 1;
		background: #fff;
		height: 100%;
		background: #373737;
		justify-content: space-between;
	}

	.bottom-btn .left .num {
		font-size: 20px;
	}
	
	.bottom-btn .left .price{
		padding: 0 10px;
		text-align: left;
	}
	
	.bottom-btn .left .price .gray{
		color: #bbb;
	}
	.bottom-btn .left .pay-by-others{
		background: #9C9C9C;
		color: #fff;
		height: 100%;
		padding: 0 30px;
		display: flex;
		align-items: center;
		font-size: 14px;
	}
	
	.bottom-btn .right {
		background: #FF1940;
		padding: 0 25px;
		height: 100%;
		line-height: 60px;
		line-height: calc(60px + env(safe-area-inset-bottom));
		line-height: calc(60px + constant(safe-area-inset-bottom));
	}

	/* 时间弹窗 */
	.timer_box {
		font-size: 28rpx;
		line-height: 1.5;
	}

	.timer_box .mask,
	.address_box .mask {
		position: fixed;
		top: 0;
		left: 0;
		height: 100%;
		width: 100%;
		background: rgba(0, 0, 0, 0.6);
		z-index: 111112;
	}

	.timer_box .timer {
		position: fixed;
		height: 800rpx;
		background: white;
		left: 0;
		bottom: 0;
		width: 100%;
		z-index: 111113;
	}

	.timer_box .timer .header {
		height: 100rpx;
		line-height: 100rpx;
		text-align: center;
		border-bottom: 1rpx solid #f1f1f1;
	}

	.timer_box .timer .content {
		display: flex;
	}

	.timer_box .timer .day {
		height: 700rpx;
		flex: 50%;
		background: #F2F2F2;
	}

	.timer_box .timer .day .item {
		text-align: center;
		height: 100rpx;
		line-height: 100rpx;
		background: #F2F2F2;
		color: #666;
	}

	.timer_box .timer .day .item.active {
		background: white;
		color: #06C1AE;
	}

	.timer_box .timer .time {
		height: 700rpx;
		padding-left: 30rpx;
	}

	.timer_box .timer .time .item {
		height: 100rpx;
		line-height: 100rpx;
		position: relative;
	}

	.timer_box .timer .time .item .price {
		margin-left: 8rpx;
		color: #999;
		display: inline-block;
	}
	.timer_box .timer .time .item .icon-gou{
		display: none;
	}

	.timer_box .timer .time .item.active .icon-gou {
		display: inline-block;
		position: absolute;
		right: 30rpx;
		font-size: 24px;
		color: #06C1AE;
	}

	/* 单选弹窗 */
	.select-box .mask {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.6);
	}

	.select-box .content {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		z-index: 9;
		color: #333;
		font-size: 32rpx;
		text-align: center;
		overflow-y: auto;
		background: #efefef;
		max-height: 600rpx;
	}

	.select-box .content .item-box {
		padding-bottom: 105rpx
	}

	.select-box .content .item {
		line-height: 90rpx;
		border-bottom: 1rpx solid #efefef;
		background: #fff;
	}

	.select-box .content .cancel {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		border-top: 1rpx solid #efefef;
		background: #efefef;
	}

	.select-box .content .cancel .item {
		margin-top: 15rpx;
	}

	/* 优惠规则弹窗 */
	.discount-rule .mask {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.8);
		z-index: 111112;
	}

	.discount-rule .content-box {
		position: fixed;
		top: 15%;
		left: 10%;
		z-index: 111113;
		background: #fff;
		width: 80%;
		border-radius: 5px;
		overflow: hidden;
	}

	.discount-rule .title {
		text-align: center;
		font-size: 16px;
		padding: 15px 0;
	}

	.discount-rule .list {
		overflow-y: auto;
	}

	.discount-rule .item {
		font-size: 12px;
		color: #666;
		padding: 0 15px 15px;
	}

	.discount-rule .btn {
		background-color: #FF1940;
		color: #fff;
		border-radius: 0;
		font-size: 16px;
		height: 45px;
		line-height: 45px;
	}
	
	.delivery-free {
		color: #FF1940;
		border:1px solid #FF1940;
		background: rgba(255, 25, 64, .11);
		border-radius: 4px;
		padding: 1px 3px;
		margin-right: 5px;
		font-size: 10px;
	}
	.repurchase-fixed{
		display: inline-block;
		background: #FFF0D1;
		font-size: 12px;
		text-align: center;
		margin:0 auto 15px;
		padding: 8px;
		border-radius: 20px;
		min-width: 60%;
		max-width: 90%;
		overflow: hidden;
	}
	.repurchase-fixed .now-price{
		color: #FF1940;
		margin-right: 5px;
	}
	.repurchase-fixed .brackets{
		margin: 0 5px;
	}
	.repurchase-fixed .name{
		max-width: 220rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		vertical-align: text-bottom;
		display: inline-block;
		margin-left: 5px;
	}
	.repurchase-fixed .iconfont{
		color: #999;
		margin-left: 5px;
		vertical-align: middle;
	}
	.discount-goods{
		background: #fff;
		border-radius: 5px;
		box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.08);
		margin: 10px 10px 0 10px;
	}
	
	.discount-goods .title{
		padding: 10px;
		font-size: 12px;
		color: #999;
	}
	.discount-goods .title .icon{
		color: #fff;
		background: #FC4D48;
		padding: 0 3px;
		border-radius: 4px;
	}
	.discount-goods .title .tag{
		color: #333;
		margin:0 5px;
		font-size: 14px;
	}
	
	.discount-goods .goods-list{
		overflow-x: auto;
		box-sizing: border-box;
		display: flex;
		padding: 0 5px;
	}
	.discount-goods .goods-list .item-wrapper{
		padding: 5px;
		flex-shrink: 0;
	}
	.discount-goods .goods-list .item-wrapper:last-child{
		padding-right: 10px;
	}
	.discount-goods .goods-list .item{
		display: flex;
		box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
	}
	
	.discount-goods .goods-list .item .img-box{
		width: 70px;
		height: 70px;
		background: #efefef;
		position: relative;
	}
	
	.discount-goods .goods-list .item .img-box .img{
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
	
	.discount-goods .goods-list .item .img-box .discount-tag{
		position: absolute;
		top: 0;
		left: 0;
		font-size: 12px;
		background: #FC4D48;
		color: #fff;
		padding: 1px 5px;
		border-radius: 0 0 15px 0;
	}
	
	.discount-goods .goods-list .item .info{
		padding: 5px 10px;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		width: 130px;
		font-size: 12px;
		color: #333;
		position: relative;
	}
	.discount-goods .goods-list .item .info .goods-name{
		text-overflow: -o-ellipsis-lastline;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		-webkit-box-orient: vertical;
		word-break: break-all;
	}
	
	.discount-goods .goods-list .item .info .now-price{
		font-size: 14px;
		margin-right: 5px;
	}
	.discount-goods .goods-list .item .info .old-price{
		text-decoration: line-through;
		color: #999;
	}
	.discount-goods .goods-list .item .info .icon-gou{
		position: absolute;
		right: 10px;
		bottom: 5px;
		font-size: 24px;
		color: #ccc;
	}
	.discount-goods .goods-list .item .info .icon-gou.active{
		color: #FF1940;
	}
	
	.discount-goods .line{
		padding: 10px 0;
		margin: 0 10px;
	}
	
	.discount-goods .line .discount-price{
		margin-right: 5px;
	}
	.discount-goods .line .right .desc{
		font-size: 16px;
	}
	.discount-goods .line .gray{
		color: #999;
	}
	.member-discount{
		margin: 10px 10px 0;
		background: #fff;
		padding: 30px 10px 15px;
		border-radius: 5px;
		box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.08);
		position: relative;
	}
	.member-discount.line .left{
		color: #999;
		font-size: 12px;
	}
	.member-discount.line .left .title{
		font-size: 14px;
		color: #373737;
		font-weight: 600;
	}
	.member-discount.line .right{
		display: flex;
		align-items: center;
	}
	.member-discount.line .right .price{
		font-size: 14px;
		margin-right: 20px;
	}
	.member-discount.line .right .iconfont{
		font-size: 24px;
		color: #ccc;
	}
	.member-discount.line .member-icon{
		position: absolute;
		top: 0;
		left: 0;
		background-image: url(../../../static/images/member-bg.png);
		background-repeat: no-repeat;
		background-size: 100% 100%;
		color: #FBDD99;
		font-size: 14px;
		padding: 2px 8px 2px 6px;
	}
	.member-discount.line .member-icon .img{
		width: 14px;
		height: 14px;
		margin-right: 5px;
	}
	
	.number-protect {
		margin: 10px 10px 0;
		background: #fff;
		padding: 15px 10px 15px;
		border-radius: 5px;
		box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.08);
	}
	
	.number-protect.line .left{
		color: #999;
		font-size: 12px;
	}
	
	.number-protect.line .left .title{
		font-size: 14px;
		color: #373737;
		font-weight: 600;
		margin-bottom: 5px;
		display: flex;
		align-items: center;
	}
	.number-protect.line .left .title .img{
		width: 20px;
		height: 20px;
		margin-right: 5px;
	}
</style>
